// -----------------------------------------------------------------------
//  <copyright file="ISettingItem.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2024 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://www.dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2024-04-15 20:34</last-date>
// -----------------------------------------------------------------------

namespace DaprPlus.Settings.Domain.Entities;

/// <summary>
/// 定义设置项
/// </summary>
public interface ISettingItem
{
    /// <summary>
    /// 获取 设置键，使用复合键设计，比如 ServiceName:Environment:Key，以区分不同服务和不同环境的配置
    /// </summary>
    string Key { get; }

    /// <summary>
    /// 获取 数据值
    /// </summary>
    object? Value { get; }

    /// <summary>
    /// 获取 数据值的类型名
    /// </summary>
    string? ValueTypeName { get; }

    /// <summary>
    /// 获取 显示名
    /// </summary>
    string? Display { get; }

    /// <summary>
    /// 获取 备注
    /// </summary>
    string? Remark { get; }

    /// <summary>
    /// 获取 顺序
    /// </summary>
    int Order { get; }

    /// <summary>
    /// 获取 是否锁定
    /// </summary>
    bool IsLocked { get; }

    long SettingDefinitionId { get; }

    /// <summary>
    /// 获取强类型数据值
    /// </summary>
    /// <typeparam name="T">强类型</typeparam>
    /// <returns></returns>
    T? GetValue<T>();
}
